<template>
  <el-row :gutter="20">
    <el-row>
      <navigator></navigator>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="8">
        <h3>获取Fisco Bcos 节点版本信息</h3>
        <el-button type="primary" @click="getNodeVersion">点击获取</el-button>
        <el-row style="text-align: left">
          <json-view :data="versionDetail"></json-view>
        </el-row>
      </el-col>
      <el-col :span="8">
        <h3>获取最新区块高度</h3>
        <el-button type="primary" @click="getBlockNumber">点击获取</el-button>
        <el-row style="text-align: left">
          <json-view :data="blockNumber"></json-view>
        </el-row>
      </el-col>

    </el-row>
  </el-row>

</template>

<script>
import Navigator from "@/components/Navigator";
// import config from '@/config'
import jsonView from 'vue-json-views';
export default {
  name: "module1",
  components: {
    Navigator,
    jsonView
  },
  data() {
    return {
      versionDetail: {},
      blockNumber: {}
    }
  },
  methods: {
    getNodeVersion() {
      this.axios.get(`/v1/level3/clientVersionGet`).then((response) => {
        console.log(response)
        this.versionDetail = response.data;

      }).catch((response) => {
        console.log(response)
      })
    },
    getBlockNumber() {
      this.axios.get(`/v1/level3/blockNumberGet`).then((response) => {
        console.log(response)
        this.blockNumber = response.data;
      }).catch((response) => {
        console.log(response)
      })
    },

  }
}
</script>

<style scoped>
pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
.string { color: green; }
.number { color: darkorange; }
.boolean { color: blue; }
.null { color: magenta; }
.key { color: red; }

</style>